#include "bBuffered.h"
#include "bIterable.h"

bool bBuffered::allocate(const unsigned long int len)
{
	if(_used+len<=_alloc)
		return false;
	while(_alloc<_used+len)
		_alloc+=_buff;
	ensure_elements(_alloc);
	return true;
}

const unsigned long int bBuffered::allocated() const{return _alloc;}

const unsigned long int bBuffered::buffer() const{return _buff;}

const unsigned long int bBuffered::buffer(const unsigned long int b){return _buff=b;}

bBuffered::bBuffered(void):_alloc(0),_buff(5){}

bBuffered::~bBuffered(void){}
